package o;

import com.huawei.appmarket.service.appmgr.bean.ApkInstalledInfo;
import com.huawei.fastengine.fastview.download.utils.PackageUtils;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

public class dtg implements Comparator<ApkInstalledInfo>, Serializable {
    private static List<String> ˏ = new ArrayList();

    public /* synthetic */ int compare(Object obj, Object obj2) {
        return ˏ((ApkInstalledInfo) obj, (ApkInstalledInfo) obj2);
    }

    static {
        ˏ.add("com.huawei.appmarket");
        ˏ.add(PackageUtils.HWGAMEBOX_PACKAGE_NAME);
    }

    public static boolean ˎ(String str) {
        return str != null && ˏ.contains(str);
    }

    public int ˏ(ApkInstalledInfo apkInstalledInfo, ApkInstalledInfo apkInstalledInfo2) {
        if (apkInstalledInfo == null || apkInstalledInfo2 == null) {
            return ˊ(apkInstalledInfo, apkInstalledInfo2);
        }
        if (ˎ(apkInstalledInfo.ʻ()) && !ˎ(apkInstalledInfo2.ʻ())) {
            return -1;
        }
        if (!ˎ(apkInstalledInfo.ʻ()) && ˎ(apkInstalledInfo2.ʻ())) {
            return 1;
        }
        if (apkInstalledInfo.ˋ() > apkInstalledInfo2.ˋ()) {
            return -1;
        }
        if (apkInstalledInfo.ˋ() < apkInstalledInfo2.ˋ()) {
            return 1;
        }
        return 0;
    }

    private int ˊ(ApkInstalledInfo apkInstalledInfo, ApkInstalledInfo apkInstalledInfo2) {
        if (apkInstalledInfo == null && apkInstalledInfo2 == null) {
            return 0;
        }
        if (apkInstalledInfo != null) {
            return -1;
        }
        return 1;
    }
}
